package com.e3roid.examples;

import com.e3roid.E3Activity;
import com.e3roid.E3Engine;
import com.e3roid.E3Scene;
import com.e3roid.drawable.sprite.TextSprite;

public class HelloLabelExample extends E3Activity {

	private final static int WIDTH  = 320;
	private final static int HEIGHT = 480;
	
	private TextSprite label;

	@Override
	public E3Engine onLoadEngine() {
		E3Engine engine = new E3Engine(this, WIDTH, HEIGHT);
		engine.requestFullScreen();
		engine.requestPortrait();
		return engine;
	}

	@Override
	public E3Scene onLoadScene() {
		E3Scene scene = new E3Scene();
		
		// Move the label to center of the screen.
		label.move((getWidth() - label.getWidth()) / 2, (getHeight() - label.getHeight()) / 2);
		scene.getTopLayer().add(label);
		
		return scene;
	}

	@Override
	public void onLoadResources() {
		// Create new Label instance with parameters fontSize=18
		label = new TextSprite("Hello, World!", 18, this);
	}

}